<?php
class TTAcl extends Zend_Acl {
	function isAllowed($role, $control, $action=null) {
		if ($role === null) {
			$user = Zend_Auth::getInstance()->getIdentity();
			foreach($user['roles'] as $r) {
				if ($this->isAllowed($r['role'], $control, $action)) {
					return true;
				}
			}
		}
		if (is_array($role)) {
			foreach($role as $r) {
				if ($this->isAllowed($r, $control, $action)) {
					return true;
				}
			}			
		} else {
			return parent::isAllowed($role, $control, $action);
		}
		
		return false;
	}
}
?>